import {createBrowserRouter} from 'react-router-dom'
import Index from '../pages/index/Index'
import Home from '../pages/home/Index'
import Login from '../pages/login/Index'
import List from '../pages/list/Index'
import Table from '../pages/list/table/Index'
import User from '../pages/user/Index'
import Error from '../pages/404/Index'
export const homerouter=[
    {
        path:"/index/home",
        title:"首页",
        element:<Home></Home>
    },
    {
        path:"/index/user",
        title:"用户管理",
        element:<User></User>
    },
    {
        path:"/index/list",
        title:"列表管理",
        element:<List></List>,
        children:[
            {
                path:"/index/list/table",
                title:"表格管理",
                element:<Table></Table>
            }
        ]
    }
]
const router =createBrowserRouter([
    {
        index:true,
        element:<Index></Index>
    },
    {
        path:"index",
        element:<Index></Index>,
        children:homerouter
    },
    {
        path:"login",
        element:<Login></Login>
    },
    {
        path:"*",
        element:<Error></Error>
    }
])
export default router;